<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@taglib uri="http://struts.apache.org/tags-html-el" prefix="html-el" %>
<%@taglib uri="http://struts.apache.org/tags-bean-el" prefix="bean-el" %>
<%@taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@taglib uri="http://struts.apache.org/tags-logic-el" prefix="logic-el" %>
<%@taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
<%@taglib uri="/WEB-INF/tld/application.tld" prefix="app" %>

	<logic:present name="cursos" scope="request">					
           <table class="tbDadosConsulta" style="width:800px">
			<tr>
				<th></th>
				<th style="width:50px">Turma</th>
				<th style="width:70px">Matrícula</th>
				<th>Descrição</th>
				<th>Data</th>
				<th>Instrutor</th>
				<th colspan="2">Documentos</th>
			</tr>
			<logic-el:iterate id="bean" name="cursos" scope="request" indexId="i">
				<tr class="linha${i%2}">
					<td style="text-align:center">${i+1}</td>
					<td align="center">
						<a href="#" onclick="turmaDetalhe(${bean.turma.codigo})">${bean.turma.codigo}</a>
					</td>
					<td align="center">
						${bean.codigo}
					</td>
					<td>${bean.turma.curso.nome}</td>
					<td style="text-align:center">
						<bean:write name="bean" property="turma.inicio" format="dd/MM/yyyy"/>
					</td>
					<td style="text-align:left">${bean.turma.instrutor.nome}</td>
					<td align="center" valign="middle">
						<logic:equal name="bean" property="turma.curso.codigo" value="4">
							<logic:equal name="bean" property="turma.encerrado" value="true">
								<a href="#" onclick="certificado(${bean.codigo})">
									<img src="_images/icones/certificate.png" border="1" title="Certificado"/>
								</a>
							</logic:equal>
						</logic:equal>
					</td>
					<td align="center" valign="middle">
						<a href="#" onclick="comprovante(${bean.codigo})">
							<img src="_images/icones/comprovante.png" border="1" title="Comprovante de Matrícula/Pagamento"/>
						</a>
					</td>
				</tr>
			</logic-el:iterate>
		</table>
	</logic:present>
	<logic:notPresent name="cursos" scope="request">
		Não há cursos realizados por este aluno.
	</logic:notPresent>
